#!/bin/bash

# postinst script for developer-object-file
#
# see: dh_installdeb(1)

#set -e

# summary of how this script can be called:
#        * <postinst> \`configure' <most-recently-configured-version>
#        * <old-postinst> \`abort-upgrade' <new version>
#        * <conflictor's-postinst> \`abort-remove' \`in-favour' <package>
#          <new-version>
#        * <postinst> \`abort-remove'
#        * <deconfigured's-postinst> \`abort-deconfigure' \`in-favour'
#          <failed-install-package> <version> \`removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PATH=/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
export PATH

if [ "${BASEDIR:=/}" = "/" ]; then
    BASEDIR=""
else
    BASEDIR_OPT="-b $BASEDIR"
fi

case "$1" in
    configure)
        chown root:bin $BASEDIR/usr/lib/elfedit
	chown root:bin $BASEDIR/usr/lib/elfedit/amd64
	chown root:bin $BASEDIR/usr/share/lib/ccs
	chown root:sys $BASEDIR/usr/share/lib
	chmod 0444 "$BASEDIR/usr/share/lib/ccs/gprof.callg.blurb"
	chown root:bin "$BASEDIR/usr/share/lib/ccs/gprof.callg.blurb"
	chmod 0444 "$BASEDIR/usr/share/lib/ccs/gprof.flat.blurb"
	chown root:bin "$BASEDIR/usr/share/lib/ccs/gprof.flat.blurb"
	chmod 0555 "$BASEDIR/system/bin/ar"
	chown root:bin "$BASEDIR/system/bin/ar"
	chmod 0555 "$BASEDIR/system/bin/gprof"
	chown root:bin "$BASEDIR/system/bin/gprof"
	chmod 0555 "$BASEDIR/system/bin/nm"
	chown root:bin "$BASEDIR/system/bin/nm"
	chmod 0555 "$BASEDIR/system/bin/ranlib"
	chown root:bin "$BASEDIR/system/bin/ranlib"
	chmod 0555 "$BASEDIR/system/bin/size"
	chown root:bin "$BASEDIR/system/bin/size"
	chmod 0555 "$BASEDIR/usr/bin/demangle"
	chown root:bin "$BASEDIR/usr/bin/demangle"
	chmod 0555 "$BASEDIR/usr/bin/dis"
	chown root:bin "$BASEDIR/usr/bin/dis"
	chmod 0555 "$BASEDIR/usr/bin/dump"
	chown root:bin "$BASEDIR/usr/bin/dump"
	chmod 0555 "$BASEDIR/usr/bin/elfdump"
	chown root:bin "$BASEDIR/usr/bin/elfdump"
	chmod 0555 "$BASEDIR/usr/bin/elfedit"
	chown root:bin "$BASEDIR/usr/bin/elfedit"
	chmod 0555 "$BASEDIR/usr/bin/error"
	chown root:bin "$BASEDIR/usr/bin/error"
	chmod 0555 "$BASEDIR/usr/bin/lari"
	chown root:bin "$BASEDIR/usr/bin/lari"
	chmod 0555 "$BASEDIR/usr/bin/mcs"
	chown root:bin "$BASEDIR/usr/bin/mcs"
	chmod 0555 "$BASEDIR/usr/bin/prof"
	chown root:bin "$BASEDIR/usr/bin/prof"
	chmod 0555 "$BASEDIR/usr/bin/rpcgen"
	chown root:bin "$BASEDIR/usr/bin/rpcgen"
	chmod 0555 "$BASEDIR/usr/bin/symorder"
	chown root:bin "$BASEDIR/usr/bin/symorder"
	chmod 0555 "$BASEDIR/usr/bin/unifdef"
	chown root:bin "$BASEDIR/usr/bin/unifdef"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/cap.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/cap.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/dyn.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/dyn.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/ehdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/ehdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/phdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/phdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/shdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/shdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/str.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/str.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/sym.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/sym.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/amd64/syminfo.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/amd64/syminfo.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/cap.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/cap.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/dyn.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/dyn.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/ehdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/ehdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/phdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/phdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/shdr.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/shdr.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/str.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/str.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/sym.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/sym.so"
	chmod 0755 "$BASEDIR/usr/lib/elfedit/syminfo.so"
	chown root:bin "$BASEDIR/usr/lib/elfedit/syminfo.so"
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

    *)
        echo "postinst called with unknown argument '$1'" >&2
        exit 1
    ;;
esac



# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

